package ae.pcfc.etks.online.itworx.ehs.web.facade.impl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import ae.pcfc.etks.online.itworx.ehs.web.exception.CommunicationException;
import ae.pcfc.etks.online.itworx.ehs.web.exception.IMSException;
import ae.pcfc.etks.online.itworx.ehs.web.facade.IMSFacade;
import ae.pcfc.etks.online.itworx.ehs.web.manager.IMSManager;
import ae.pcfc.etks.online.itworx.ehs.web.model.IMSComment;

public class IMSFacadeImpl extends BaseFacade implements IMSFacade {

	private IMSManager imsManager;

	public IMSManager getImsManager() {
		return imsManager;
	}

	public void setImsManager(IMSManager imsManager) {
		this.imsManager = imsManager;
	}

	@Transactional
	@Override
	public String createIMPSRecord(String inspectionCode, String category,
			String buCode, String requestorId, String createdBy) throws IMSException,CommunicationException {
		return imsManager.createIMPSRecord(inspectionCode, category, buCode, requestorId, createdBy);
	}

	@Transactional
	@Override
	public String cancelIMPSRecord(String imsLogId) throws IMSException ,CommunicationException{
		return imsManager.cancelIMPSRecord(imsLogId);
	}

	@Transactional(readOnly = true)
	@Override
	public String retrieveIMSStatus(String imsLogId) throws IMSException,CommunicationException {
		return imsManager.retrieveIMSStatus(imsLogId);
	}

	@Transactional(readOnly = true)
	@Override
	public List<IMSComment> retrieveIMSComments(String imsLogId) throws IMSException,CommunicationException {
		return imsManager.retrieveIMSComments(imsLogId);
	}

	@Transactional
	@Override
	public String setIMSCustomerReply(String imsLogId,	List<IMSComment> commentsRecords) throws IMSException ,CommunicationException{
		return imsManager.setIMSCustomerReply(imsLogId, commentsRecords);
	}


}
